package com.zzl.bonds.ticket.dto.credit;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.zzl.apidoc.annotation.ApidocModel;
import com.zzl.apidoc.annotation.ApidocModelProperty;
import com.zzl.general.common.utils.DoubleSerialize;
import lombok.Data;

import java.util.Date;

/**
 * @author : spp
 * @date : 2022/3/1 14:54
 */
@ApidocModel
@Data
public class SubsidiaryQuotaDto {

    @ApidocModelProperty(description = "主键 uuid")
    private String id;
    @ApidocModelProperty(description = "核心企业授信id")
    private String coreEnterpriseCreditId;
    @ApidocModelProperty(description = "子公司id")
    private String enterpriseId;
    @ApidocModelProperty(description = "子公司名称")
    private String enterpriseName;
    @JsonSerialize(using = DoubleSerialize.class)
    @ApidocModelProperty(description = "额度上限")
    private Double quotaMaxLimit;
    @JsonSerialize(using = DoubleSerialize.class)
    @ApidocModelProperty(description = "已用额度")
    private Double usedQuota;
    @JsonIgnore
    private Double usedAmount;

    public Double getUsedQuota() {
        return usedAmount;
    }
    @JsonSerialize(using = DoubleSerialize.class)
    @ApidocModelProperty(description = "剩余金额")
    private Double surplusAmount;
    @JsonSerialize(using = DoubleSerialize.class)
    @ApidocModelProperty(description = "冻结额度 ")
    private Double frozenAmount;
    @JsonSerialize(using = DoubleSerialize.class)
    @ApidocModelProperty(description = "冻结额度/平台操作的锁定额度")
    private Double lockAmount;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApidocModelProperty(description = "更新日期", validate = "yyyy-MM-dd")
    private Date updateTime;
    @ApidocModelProperty(description = "备注")
    private String remark;

}
